// --------------------------------------------------------------------------------------------------------------------
// <copyright file="JPluginInfoStruct.cs" company="Jarno Burger / Dennis de Bruijn">
//   Jarno Burger / Dennis de Bruijn
// </copyright>
// <summary>
//   information on the plugin.
// </summary>
// --------------------------------------------------------------------------------------------------------------------

namespace ManagedFreeFrame.Struct
{
    using System.Runtime.InteropServices;

    /// <summary>
    ///   information on the plugin.
    /// </summary>
    /// <remarks>
    /// Plugins of PluginType effect are passed frames of video, which they then modify. 
    /// Source plugins are simply passed a pointer where they paint frames of video. 
    /// One example of a source plugin would by a visual synthesizer which uses the parameters to synthesize video.
    /// 
    /// FreeFrame APIMinorVersion numbers should always have 3 digits -
    /// - so divide the minor version number by 1000 and add the major version number to get the full version number. 
    /// Example: for version 0.511, APIMajorVersion=0 and APIMinorVersion=511
    /// </remarks>
    [StructLayout(LayoutKind.Sequential, CharSet = CharSet.Ansi)]
    // ReSharper disable MemberCanBeInternal
    // ReSharper disable FieldCanBeMadeReadOnly.Global
    public struct PluginInfoStruct
    {
        /// <summary>
        ///   Represents number before decimal point in version numbers
        /// </summary>
        [MarshalAs(UnmanagedType.U4)] 
        public readonly int ApiMajorVersion;

        /// <summary>
        ///   Represents number after decimal point in version numbers
        /// </summary>
        [MarshalAs(UnmanagedType.U4)] 
        public readonly int ApiMinorVersion;

        /// <summary>
        ///   Unique ID for plugin
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 4)] 
        public readonly string UniqueId;

        /// <summary>
        ///   Name of plugin
        /// </summary>
        [MarshalAs(UnmanagedType.ByValTStr, SizeConst = 16)] 
        public string PluginName;
        
        /// <summary>
        ///   Current meaningful values (see remarks):
        ///   0 = effect
        ///   1 = source
        /// </summary>
        [MarshalAs(UnmanagedType.U4)] 
        public uint PluginType;
    }
    // ReSharper restore MemberCanBeInternal
    // ReSharper restore FieldCanBeMadeReadOnly.Global
}